An electronic device such as a smart phone, a tablet is often provided with a projection module to support projection display. When used by a user to perform projection display, the electronic device will inevitably be moved (for example, when user wants to adjust the position of the electronic device), and the projection module needs to be turned off to prevent projected light beam, which has a high brightness when performing the projection display, from being projected towards human eyes; and then the projection module needs to be restarted when necessary, resulting in tedious operations. In the prior art, there is no efficient solution by which the projected light beam may be prevented from being projected towards human eyes and the frequent switching on and off of the projection module may be omitted.